#include "ClientMgr.h"

CClientMgr::CClientMgr()
{

}
CClientMgr::~CClientMgr()
{

}
bool CClientMgr::AddPos2Handle(unsigned int pos, ClientHandler *hd)
{
	return m_mapUsr2Client.insert(make_pair(pos, hd)).second;
}
bool CClientMgr::RemovePos2Handle(unsigned int pos)
{
	return m_mapUsr2Client.erase(pos) == 1;
}
ClientHandler* CClientMgr::GetHandleByPos(unsigned int pos)
{
	map<unsigned int, ClientHandler*>::iterator itr = m_mapUsr2Client.find(pos);
	if (itr != m_mapUsr2Client.end())
	{
		return itr->second;
	}
	return NULL;
}